//
//  EFGoodsDetailViewCellBanner.m
//  EnjogFood
//
//  Created by guocheng on 2017/5/21.
//  Copyright © 2017年 wf. All rights reserved.
//

#import "EFGoodsDetailViewCellBanner.h"
#import "EFGoodsDetailViewItemBanner.h"

@interface EFGoodsDetailViewCellBanner ()

@property(strong,nonatomic)UIImageView* bannerIV;

@end

@implementation EFGoodsDetailViewCellBanner


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = [UIColor clearColor];
        self.backgroundColor = [UIColor whiteColor];
        [self initView];
    }
    return self;
}

-(void)setObject:(EFGoodsDetailViewItemBanner *)item{
    [self.bannerIV setImageWithURL:[NSURL URLWithString:item.bannerImg]];
}


-(void)initView{
    [self.contentView addSubview:self.bannerIV];
}


-(UIImageView *)bannerIV{
    if(_bannerIV == NULL){
        _bannerIV = [[UIImageView alloc ] initWithFrame:CGRectMake(0, 0, kScreenWidth, 82)];
        _bannerIV.backgroundColor = RGBCOLOR(0xf3f3f3);
        _bannerIV.contentMode = UIViewContentModeScaleAspectFill;
        _bannerIV.clipsToBounds = YES;
    }
    return _bannerIV;
}

@end
